#include "mainapp.h"

mainApplication::mainApplication(int &argc, char **argv)
    : QApplication(argc, argv)
{
}

mainApplication::~mainApplication()
{
}

mainApplication *mainApplication::instance()
{
    return (static_cast<mainApplication *>(QCoreApplication::instance()));
}
MainWindow *mainApplication::newMainWindow()
{
    MainWindow *mwin = new MainWindow();
    m_mainWindows.prepend(mwin);
    mwin->show();
    return mwin;
}

MainWindow *mainApplication::mainWindow()
{
    if (m_mainWindows.isEmpty())
        newMainWindow();
    return m_mainWindows[0];
}
